package com.cha.chaCommon.core.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/*
@Author  hkf
@date 2024/10/29
--轻舟已过万重山--
*/
// 修饰的类表示配置类
@Configuration
public class MyTheadPoolConfig {
    @Bean
    public ThreadPoolExecutor getMyTheadPool(){
        return new ThreadPoolExecutor(
                4,
                8,
                600,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(100)
        );
    }
}
